<?php

namespace App\Listeners;

use App\Events\GoldChargePaidEvent;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;

class GoldChargePaidListener
{
    public function handle(GoldChargePaidEvent $event)
    {
    	$goldCharge = $event->goldCharge;
        $coins = $goldCharge->total_amount;
        $data = ['gold_charge_id', $goldCharge->id];
	    account_coins($goldCharge->user)->plusEachGoldCharge($coins, $data);
    }
}
